package com.feng.aop.service;

import com.feng.aop.mapper.Stu_mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class Stu_Service {

    @Autowired
    private Stu_mapper stu_mapper;

    //加上事务注解
    @Transactional
    public void insertStu(){
        System.out.println("开始执行插入方法");
        stu_mapper.insert();
       // int i=1/0;
        System.out.println("插入完成");
    }
}
